Skip to content

v2-GDS01: cover streamed replies in output controls - #135

Open
ninadphalak wants to merge 1 commit into
GenAI-Security-Project:mainfrom
ninadphalak:gds01-streamed-output
Open

ninadphalak wants to merge 1 commit into
GenAI-Security-Project:mainfrom
ninadphalak:gds01-streamed-output

Conversation

@ninadphalak

Copy link
Copy Markdown

Summary

GDS01-T1-04 asks for personal data and secret detectors on generated output. It does not say what the detector has to do when the reply is streamed, and most chat interfaces and agent runtimes stream.

One example shows the gap. The model writes an email address and the stream happens to cut it, so one chunk ends with jane.doe@exa and the next starts with mple.com. A detector that looks only at single chunks sees two harmless fragments. A detector that checks the whole reply at the end finds the address after the user has already seen it. In both cases the log can show a detection while the value was delivered.

This PR:

  • Threat actors and preconditions: the last precondition now also names output filtering that is applied to each chunk of a streamed reply on its own.
  • Mitigations: GDS01-T1-04 now says the detectors run before output is released, and that streamed text is held back until no match can still extend into it. It is still one sentence.
  • Verification for GDS01-T1-04: the seeded test strings are also sent as a streamed reply, split between chunks at every position.
  • Incidents and research: adds one public case, mastra-ai/mastra#23783 (fixed in #24189 there). A streaming redactor with a fixed carry-over logged a redaction while the first part of the value had already gone out. The fix holds text back.
  • References: adds the OWASP AI Exchange section on sensitive output handling, which gives the same hold-back rule and the every-split test. It is reference 8 of 8.

Nothing else changes. The CVEs are untouched. The entry is about 1,360 words excluding references, and every section stays within its limit.

DSGAI mapping

DSGAI01. Related: #118, which makes the same point for Best Practices v2, Part 5.

Checklist

  • Organizations are named only as the affected party, and every claim is backed by a public source link
  • Entries reference at least one DSGAI ID where applicable
  • Validation scripts pass (python data_validation/run_all_checks.py)
  • One entry per file for dataset contributions (not a dataset contribution)

Questions

  • Tier 1 and Tier 2 both have five controls, so I folded this into T1-04. If you would rather have it as a control of its own, tell me which one should move and I will redo it.
  • Is "Research" the right type for a public bug report and its fix, or should it be "Incident"?

Disclosure

I wrote the streamed-output bullet in the AI Exchange section cited above. I did not report or fix the Mastra issue; I added a regression test to that project afterwards. This PR links to none of my own reports or tools.

Ninad Phalak, independent security researcher

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant